change type attribute javascript